<template>
  <view class="page flex-col">
    <view class="group_3 ">
      <view class="section_1 flex-row ">
        <view class="box_1 flex-row flex-col mt-6">
          <view class="flex-row align-center justify-start">
            <text class="text-group_1 txt ml_20">公司名称:</text>
            <nut-input class="wp100 noborder" v-model="submitmain.name" placeholder="必填项" />
          </view>
        </view>
      </view>
      <view class="section_1 flex-row mt-6">
        <view class="box_1 flex-row">
          <view class="flex-row align-center justify-start">
            <text class="text-group_1 txt ml_20">岗位名称:</text>
            <nut-input class="wp100 noborder" v-model="submitmain.name" placeholder="必填项" />
          </view>
        </view>
      </view>

   

      <view class="section_1 flex-row mt-6">
        <view class="box_1 flex-row">
          <view class="flex-row align-center justify-start">
            <text class="text-group_1 txt ml_20">从事行业:</text>
            <nut-input class="wp100 noborder" v-model="submitmain.name" placeholder="必填项" />
          </view>
        </view>
      </view>

      <view class="section_1 flex-row mt-6">
        <view class="box_1 flex-row">
          <view class="flex-row align-center justify-start">
            <text class="text-group_1 txt ml_20">工作内容:</text>
            <nut-input class="wp100 noborder" v-model="submitmain.name" placeholder="必填项" />
          </view>
        </view>
      </view>
  
      <view class="section_13 flex-row justify-between">
        <view class="text-wrapper_5 border flex-col">
          <text class="text_11">取消</text>
        </view>
        <view class="text-wrapper_6 flex-col">
          <text class="text_12">保存</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup lang="ts">
import '@/static/common.less';
import './index.less';
import { getCurrentInstance, reactive, ref } from 'vue';
import Taro, {
  useLoad,
  usePullDownRefresh,
  useReachBottom,
  useShareAppMessage,
  useShareTimeline,
  useTitleClick,
} from '@tarojs/taro';
import { CategoryType, getCategoriesApi } from '@/api/categories';
import ProtoList from '@/components/proto-list/index.vue';
// import LoadMoreBottom from '@/components/load-more-bottom/index.vue';
import { getProtoListApi, ProtoType } from '@/api/proto';
import SimpleTabs from '@/components/simple-tabs/index.vue';
import { TARO_RUNTIME } from '@tarojs/runtime';
const container2 = ref(null);

// const windowInfo = Taro.getWindowInfo();
// const { proxy } = getCurrentInstance();
const query = ref({
  page: 1,
  limit: 6,
  category_id: '',
  sort_by: '',
  keywords: '',
});
const submitmain = reactive({
  name: '',
  radioVal: 1,
});
const toSearch = () => {
  Taro.navigateTo({ url: '/pages/search/index' });
};
let list = reactive([
  { value: 1, text: '男', checked: true },
  { value: 0, text: '女', checked: false },
]);
// const scrollTop = ref(0);
// const protoListLoading = ref(false);
// const noMore = ref(true);
const categories = ref<CategoryType[]>([]);
const protoItems = ref<ProtoType[]>([]);
const tab1value = ref('0');
const onChange = () => {};
// const protoTotal = ref<number>(0);
// const sortType = ref([
//   { text: '默认排序', value: '' },
//   { text: '累计销量', value: 'sales' },
//   { text: '佣金比例', value: 'commission_ratio' },
// ]);
// const getCategories = () => {
//   categories.value = [];
//   categories.value.push({ id: '', name: '全部分类', icon: '' });
//   getCategoriesApi({}).then((res) => {
//     if (res.success) {
//       categories.value = categories.value.concat(res.result);
//     }
//   });
// };
const handleProtoClick = (proto: ProtoType) => {
  console.log(handleProtoClick);
};
// const refreshLoading = ref(false);
// const getProtoList = () =>ut-sticky {
//   if (protoListLoading.value === true) {
//     return;
//   }
//   query.value.page = 1;
//   protoListLoading.value = true;
//   refreshLoading.value = true;
//   getProtoListApi(query.value)
//     .then((res) => {
//       if (res.success) {
//         protoItems.value = res.result.items;
//         protoTotal.value = res.result.total;
//         noMore.value = !res.result || !res.result.total || res.result.total < query.value.limit;
//       }
//     })
//     .finally(() => {
//       protoListLoading.value = false;
//       refreshLoading.value = false;
//     });
// };
// const moreLoading = ref(false);
// const loadMore = () => {
//   if (moreLoading.value || noMore.value) {
//     return;
//   }
//   moreLoading.value = true;
//   query.value.page += 1;
//   setTimeout(() => {
//     getProtoListApi(query.value)
//       .then((res) => {
//         if (res.success) {
//           if (res.result.items && res.result.items.length) {
//             protoItems.value = protoItems.value.concat(res.result.items);
//             protoTotal.value = res.result.total;
//             noMore.value = !res.result || !res.result.total || res.result.total < query.value.limit;
//           } else {
//             noMore.value = true;
//           }
//         }
//       })
//       .finally(() => {
//         moreLoading.value = false;
//       });
//   }, 100);
// };
// useShareAppMessage((res) => {
//   if (res.from === 'button') {
//     // 来自页面内转发按钮
//     console.log(res.target);
//   }
//   return {
//     title: '抖带选 - 抖音达人带货选品快速变现平台',
//   };
// });

// const handleTabClick = (tab) => {
//   console.log(tab);
//   if (!tab) {
//     return;
//   }
//   query.value.category_id = tab.id;
//   getProtoList();
// };
// useShareTimeline(() => {
//   console.log('分享朋友圈');
//   return {};
// });

// usePullDownRefresh(() => {
//   console.log('下拉');
//   setTimeout(() => {
//     getCategories();
//     getProtoList();
//     Taro.stopPullDownRefresh();
//   }, 300);
// });
// useTitleClick(() => {
//   console.log('标题点击');
// });
// useReachBottom(() => {
//   console.log('底部');
//   loadMore();
// });
// useLoad(() => {
//   getCategories();
//   getProtoList();
// });
</script>
